package com.t194.vo;

import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDate;

/**
 * 用户的数据传输对象data-transfer-object
 * 用于收集动态查询的条件
 */
public class UserDto {

        private String username;
        private Integer roleId;
        @DateTimeFormat(pattern = "yyyy-MM-dd")
        private LocalDate startDate;
        @DateTimeFormat(pattern = "yyyy-MM-dd")
        private LocalDate endDate;


        public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Integer getRoleId() {
        return roleId;
    }

    public void setRoleId(Integer roleId) {
        this.roleId = roleId;
    }

    public LocalDate getStartDate() {
        return startDate;
    }

    public void setStartDate(LocalDate startDate) {
        this.startDate = startDate;
    }

    public LocalDate getEndDate() {
        return endDate;
    }

    public void setEndDate(LocalDate endDate) {
            if(endDate!=null){
                this.endDate = endDate.plusDays(1);
            }

    }


}
